﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using UIBase;
using MFTool;
using MF_Base.Model;
using System.ComponentModel.Composition;
using MF_Base;
using AutoUI.Areas.ConfigUI.Controllers;

namespace AutoUI.Areas.Sys.Controllers
{
    [Export]
    public class DefineHomeController : EntityFormController<DefineHome>
    {
        public ActionResult DefineHomePanel()
        {
            return View();
        }

        protected override void AfterGetData(bool isNew, Dictionary<string, object> dic)
        {
             
        }

        protected override void BeforeSave(bool isNew, Dictionary<string, object> dic)
        {
            List<DefineHomePanel> DefineHomePaneltoSave = new List<DefineHomePanel>();
            //UnitOfWork.Update()
        }

        public JsonResult GetList()
        {
            int totalCount = 0;
            int pageId = Convert.ToInt32(QueryString("page"));
            int pageSize = Convert.ToInt32(QueryString("rows"));
            IEnumerable<DefineHome> baseForms = UnitOfWork.GetByPage<DefineHome, string>(out totalCount, pageSize, pageId, a => a.Id, false);
            return Json(new { rows = baseForms, total = totalCount });
        }
    }
}